<template>
	<view class="content">
		<view class="Nav" style="display: flex;align-items: center;background: transparent;opacity: 1;padding: 113rpx 30rpx 35rpx 30rpx;position: fixed;top: 0;
			left: 0;width: 100%;">
			<u-icon name="arrow-left" size="40rpx" color="#fff" @click="Goback"></u-icon>
			<view style="font-weight: bold;font-size: 36rpx;color: #FFFFFF;margin-left: 244rpx;">
				我的余额
			</view>
			<view style="font-size: 32rpx;color: #FFFFFF;flex:1;text-align: right;"
				@click="navigateToHandle('./details')">
				余额明细
			</view>
		</view>
		<view style="height:193rpx ;">

		</view>
		<view class="IconIcon" style="display: flex;align-items: center;flex-direction: column;">
			<image src="/static/money.png" style="width: 280rpx;height: 280rpx;margin-top: 114rpx;" mode=""></image>
			<view style="margin: 30rpx 0 20rpx 0;font-size: 32rpx;color: #fff; ">
				总资产
			</view>
			<view style="font-size: 80rpx;font-weight: bold;color: #fff;margin-bottom: 96rpx;">
				{{userInfo.balance}}
			</view>
			<view @click="navigateToHandle('./recharge')"
				style="width: 518rpx;height: 95rpx;background: linear-gradient(180deg, #F2D7AA 0%, #DEBC86 100%);opacity: 1;border-radius: 20rpx;text-align: center;line-height: 95rpx;color: #000;font-size: 40rpx;margin-bottom: 50rpx;">
				充值
			</view>
			<view @click="navigateToHandle('./withdraw_cash')"
				style="width: 518rpx;height: 95rpx;background: #202126FF;opacity: 1;border-radius: 20rpx;text-align: center;line-height: 95rpx;font-size: 40rpx;color: #B9B9B9;">
				提现
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userInfo: {},
				platform: 'ios'
			}
		},
		onShow() {
			this.getUserInfo();
		},
		methods: {
			Goback() {
				uni.navigateBack()
			},
			// 获取用户信息
			getUserInfo() {
				let _this = this;
				uni.getSystemInfo({
					success: function(res) {
						_this.platform = res.platform;
					}
				});

				this.$api.userInfo({}, res => {
					if (res.status) {
						this.userInfo = res.data
					} else {
						this.$common.errorToShow(res.msg)
					}
				})
			},
			// 页面跳转
			navigateToHandle(pageUrl) {
				this.$common.navigateTo(pageUrl)
			}
		}
	}
</script>

<style>
	.withdrawcash-top {
		padding: 40upx 26upx;
		background-color: #FF7159;
		color: #fff;
	}

	.withdrawcash-title {
		font-size: 28upx;
		display: block
	}

	.withdrawcash-num {
		font-size: 70upx;
		display: block;
		margin-top: 20upx;
		margin-left: 50upx;
	}

	.margin-cell-group {
		margin: 20upx 0;
		color: #666666;
	}
</style>